#ifndef APPPATH_H
#define APPPATH_H

#include <QObject>
#include <QCoreApplication>
#include <QDir>
#include <QDebug>


class AppPath:public QObject
{
    Q_OBJECT
public:
    AppPath();
    static AppPath* GetInstance();


    //返回应用程序当前目录的绝对路径
    static Q_INVOKABLE QString getParent();
    //带程序名称的返回
    //--> G:/MyApp/projectSelf/bin_release/zxx-qml-UI.exe
    static Q_INVOKABLE QString getCurrent();
    //不带程序名称的返回
    //--> G:/MyApp/projectSelf/bin_release
    static Q_INVOKABLE QString getPath();
    //获取资源路径
    static Q_INVOKABLE QString getAppResource();
    //获取配置文件路径
    static Q_INVOKABLE QString getAppConf();
    //获取脚本路径
    static Q_INVOKABLE QString getAppScript();
    //获取home路径
    //--> C:/Users/User01
    static Q_INVOKABLE QString getAppHome();
    //获取root路径
    //--> C:/
    static Q_INVOKABLE QString getAppRoot();
    //获取temp路径
    //--> C:/Users/User01/AppData/Local/Temp
    static Q_INVOKABLE QString getAppTemp();



private:
    QString appPath;
    static AppPath * instance;
};

#endif // APPPATH_H
